]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Remove pre-GNOME-2.26 panel-replacement code
authorOwen W. Taylor <otaylor@fishsoup.net>
Thu, 27 Aug 2009 20:19:35 +0000 (16:19 -0400)
committerOwen W. Taylor <otaylor@fishsoup.net>
Fri, 28 Aug 2009 16:34:04 +0000 (12:34 -0400)
gnome-shell.in: Remove the code to replace gnome-panel by attaching
  to it with GDB; this was always problematical (required gdb, debug
  symbols, finding the pid of gnome-panel, etc.)

gnome-shell-build-setup.sh: Require 2.26 to be in place before building
  the shell; remove gdb from the list of required packages.

http://bugzilla.gnome.org/show_bug.cgi?id=593325

src/gnome-shell.in
tools/build/gnome-shell-build-setup.sh

index 9be3fe80f306f58ff70168ed43d3664e6638648b..a9003a39ac7e31d5f90ab310c456fdcd87d3a972 100644 (file)
@@ -14,63 +14,6 @@ import termios
 import time
 import errno
 
-def find_cmd (cmd_list):
-    """
-    Takes a list of command candidates and returns the first one that exists.
-    Raises a system exit if none of the commands exist.
-    """
-    for cmd in cmd_list:
-        if os.path.exists(cmd):
-            return cmd
-    
-    raise SystemExit("None of the commands %s exist" % cmd_list)
-    
-def pidof(command):
-    pidof_cmd = find_cmd(["/sbin/pidof", "/bin/pidof", "/usr/bin/pidof"])
-    pidof = subprocess.Popen([pidof_cmd, command], stdout=subprocess.PIPE)
-    pids = pidof.communicate()[0].split()
-    pidof.wait()
-
-    # pidof doesn't have a "current user only" option, so we may have
-    # gotten the pids of other users' processes. Fix that.
-    for pid in pids:
-        try:
-            os.kill(int(pid), 0)
-            return pid
-        except Exception, e:
-            pass
-    return None
-
-def kill_legacy_gnome_panel():
-    # Do import lazily to save time and memory
-    import dbus
-
-    # In Gnome 2.26 the panel grabs a dbus name and allows replacement
-    bus = dbus.Interface(dbus.SessionBus().get_object('org.freedesktop.DBus', '/org/freedesktop/DBus'),
-                         'org.freedesktop.DBus')
-    names = bus.ListNames()
-    if 'org.gnome.Panel' in names:
-        # OK, we have the new replaceable gnome panel (or gnome-shell), all we have to
-        # do is start the shell
-        return
-
-    gnome_panel_pid = pidof("gnome-panel")
-    if gnome_panel_pid is None:
-        # No gnome-panel, nothing to do
-        return
-
-    if options.verbose:
-        print "Terminating panel process %s" % pid
-
-    # We can't just kill it, since the session will auto-start it again, so
-    # we do this horrible thing
-    devnull = open("/dev/null", "w")
-    subprocess.call(["gdb", "-batch-silent",
-                     "-ex", "call panel_session_do_not_restart()",
-                     "-ex", "call exit(0)",
-                     "-p", gnome_panel_pid], stdout=devnull, stderr=devnull)
-    devnull.close()
-
 def start_xephyr():
     tmpdir = tempfile.mkdtemp("", "gnome-shell.")
     atexit.register(shutil.rmtree, tmpdir)
@@ -317,8 +260,6 @@ try:
         shell = start_shell()
     else:
         xephyr = None
-        if options.replace:
-            kill_legacy_gnome_panel()
         shell = start_shell()
 
     # Wait for shell to exit
index 5bcda53d56a7743621960f55c57511f92f524b3f..885f0fc490d348ca78b0e608cb734e31a3bf6425 100755 (executable)
 # Copyright (C) 2006, 2007, 2008 Imendio AB
 #
 
+# Pre-check on GNOME version
+
+gnome_version=`gnome-session --version 2>/dev/null | (read name version && echo $version)`
+have_gnome_26=false
+case $gnome_version in
+    2.2[6789]*|2.[3456789]*|3.*)
+       have_gnome_26=true
+    ;;
+esac
+
+if $have_gnome_26 ; then : ; else
+   echo "GNOME 2.26 or newer is required to build GNOME Shell" 1>&2
+   exit 1
+fi
+
+############################################################
+
 if which lsb_release > /dev/null 2>&1; then
   system=`lsb_release -is`
 elif [ -f /etc/fedora-release ] ; then
@@ -35,7 +52,7 @@ fi
 # ({mozilla,firefox,xulrunner}-js), xdamage
 #
 # Non-devel packages needed by gnome-shell and its deps:
-# gdb, glxinfo, gstreamer-plugins-base, gstreamer-plugins-good,
+# glxinfo, gstreamer-plugins-base, gstreamer-plugins-good,
 # python, Xephyr, xeyes*, xlogo*, xterm*, zenity
 #
 # (*)ed packages are only needed because gnome-shell launches them
@@ -88,7 +105,7 @@ if test x$system = xFedora ; then
     librsvg2-devel libwnck-devel mesa-libGL-devel python-devel readline-devel \
     xulrunner-devel libXdamage-devel \
     gstreamer-devel gstreamer-plugins-base gstreamer-plugins-good \
-    gdb glx-utils xorg-x11-apps xorg-x11-server-Xephyr xterm zenity \
+    glx-utils xorg-x11-apps xorg-x11-server-Xephyr xterm zenity \
     ; do
       if ! rpm -q $pkg > /dev/null 2>&1; then
         reqd="$pkg $reqd"